
**** Author : Rithika Kumar ***** 
**** Purpose: Main results from original survey 2022 ****
**** Code for the following Tables: Table 1, ******

*****************************************
*	Setting Paths		                *
*****************************************
** Set path to "JOP Replication files" folder on your computer 

ssc install estout 

use "DATA FILES TO SHARE/data_for_analysis_RK_controls.dta", clear

gen mobility_govt_ever_index = mob_govt_loc_1 + mob_govt_loc_2 + mob_govt_loc_3 + mob_govt_loc_4 + mob_govt_loc_5
label var mobility_govt_ever_index "Mobility: State and institutions"


egen zmob = std(mob_govt_ever_index) 
egen zclaim_welf = std(claim_contact_welfare_index) 
egen zclaim_proc = std(claim_procedure_index) 
egen zclaim_prob = std(claim_contact_problem) 
egen zcivic = std(civic_index) 

est clear
foreach i in zmob zcivic zclaim_welf zclaim_proc zclaim_prob  {
  reghdfe `i' i.mig_dummy i.caste i.household_inc i.religion edu1 edu2 edu3 edu4 edu5 i.own_inc agri_land_own_acre agri_land_leasein_acre joint_fam_correct, absorb(block_not_mig_list) vce(cluster block_not_mig_list)   
eststo controls_`i'

}

 esttab controls_* using "OUTPUT/TABLES/Table_1.tex", keep(1.mig_dummy) star(* 0.10 ** 0.05 *** 0.01) collabels(none) label stats( r2 N, fmt(%9.4f %9.0fc) labels( "R-squared" "Observations")) plain b(a2) se(%9.2f) noabbrev se nonumbers  lines parentheses replace fragment
 
 
